Added Vertical tabs (left, right). Some work was done by Douglas Brown
Allow runtime setting of tab margins, height, style.
Modified ALT+mnemonic view switching to not require accelerator definitions.
Changed "toupper" to "AnsiUpper".
Changed hardcoded RGB values to use GetSysColor.
Fixed bug with OnMouseActivate.
Version Date
1.1 3/16/94
Removed extra frame in each view.
Added code for ALT+Mnemonic view switching.
Added suggestions from various people in the forum.
Added MS Word 6.0 look to tabs (compliments of David Hollifield).
Version Date
1.0 2/15/94 Initial posting
Description
This is a sample application using the CTabView class. Expand the zip file
using the -d option and use VC++ to build the project. The project uses the DLL version of MFC (mfc250d.dll) which should be in your windows\system directory.
To use the CTabView class in your own projects do the following:
1. Subclass CTabView with the class you wish to manage your tabs (e.g.
CMainView : public CTabView ... You should provide an "OnInitialUpdate" member
method.
2. Add tabview.cpp and your subclass of CTabView to your project.
3. Modify the application class to use your view class. Modify the include file name to be your
view.h. Modify your document template to specify the new view (e.g.)
AddDocTemplate(new CMultiDocTemplate(IDR_TABTYPE,
RUNTIME_CLASS(CTabDoc),
RUNTIME_CLASS(CMDIChildWnd), // standard MDI child frame
RUNTIME_CLASS(CMainView))); // your view goes here
4. In your OnInitialUpdate method add your views to the CTabView class using the method
This example creates three tabs (Options, Graphics, and Edit). The last thing done in the
OnInitialUpdate method is to call the base class OnInitialUpdate method.
5. If you override the OnDraw method of CTabView you must call the CTabView::OnDraw
method as well.
6. If you override the OnSize method of CTabView you must call the CTabView::OnSize
method as well.
Known Problems/Limitations
1. A disabled tab currently uses the system color COLOR_GRAYTEXT; this may not yield a color that will work for all color schemes and result in the text being invisible. In the future I will fix this to use the GrayString function.
2. The Chicago look is only implemented for the TABSONTOP orientation.
3. For vertical orientations the underline is not drawn for the tab mnemonic. The reason for this is that TextOut doesn't support automatic underlining.
Disclaimer, etc.
Any questions, problems, suggestions, etc. should be directed to the author Gerry High 74750,2456 CIS. Feel free to use this in your own programs. This class is freeware and is provided as is. In the near future I may update this class to support multi-row tabs and dialog support. Other possibilities include tear-off tabs and owner draw tabs.